package com.jiker;

/**
 * @author leo
 * @date 2021/6/17
 */
public class Area {
    private final Coordinates A;

    private final Coordinates B;

    private final Coordinates C;

    private final Coordinates D;


    public Area(Coordinates a, Coordinates b, Coordinates c, Coordinates d) {
        A = a;
        B = b;
        C = c;
        D = d;
    }

    public boolean contains(Coordinates coordinates) {
        boolean x = B.x() <= coordinates.x() && coordinates.x() <= A.x();
        boolean y = D.y() <= coordinates.y() && coordinates.y() <= A.y();
        return x && y;
    }
}

